home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Demos / Interactive Wave / _DATAS / SHARED.Dxr / 00978_Macro gestion Boutons de la Barette (Sauf -Quitter-).ls < prev    next >
Encoding:
Text File  |  1995-08-06  |  5.7 KB  |  199 lines

  1. on Logo
  2.   global CheminDisk, SprBoutBar
  3.   set NomFichier to CheminDisk & ":_DOSNAV:MOU5"
  4.   PlaySound(2, "Play", NomFichier)
  5.   updateStage()
  6.   set t to " N_LOGO"
  7.   set C to t & t & "2" & t & "3" & t & "4" & t & "5" & t & "6" & t & "7" & t & "8" & t & "7" & t & "8" & t & "7" & t & "8" & t & "7" & t & "8" & t & "7" & t & "8" & t & "7" & t & "6" & t & "5" & t & "4" & t & "3" & t & "2" & t & "1"
  8.   AnimBouton(C)
  9. end
  10.  
  11. on Course
  12.   PlaySoundVide(1, "PUPPET", "Fusee")
  13.   updateStage()
  14.   set t to " N_Course"
  15.   set C to t & t & "2" & t & "3" & t & "4" & t & "5" & t & "6" & t & "7" & t & "8" & " N_Vide"
  16.   AnimBouton(C)
  17. end
  18.  
  19. on SonMoins
  20.   global SprBoutBar, SprFondBar, CastBarrette, CastEfface
  21.   set NiveauVolume to the soundLevel
  22.   if NiveauVolume > 0 then
  23.     SetVolume(NiveauVolume - 1)
  24.     set GraphSound to the number of cast "SonMoins"
  25.   else
  26.     set GraphSound to the number of cast "N_LimitSon"
  27.   end if
  28.   if the castNum of sprite SprFondBar = CastBarrette then
  29.     set the castNum of sprite SprBoutBar to GraphSound
  30.     updateStage()
  31.     RestoreBoutBar()
  32.   end if
  33. end
  34.  
  35. on SonPlus
  36.   global SprBoutBar, SprFondBar, CastBarrette, CastEfface
  37.   set NiveauVolume to the soundLevel
  38.   if NiveauVolume < 7 then
  39.     SetVolume(NiveauVolume + 1)
  40.     set GraphSound to the number of cast "SonPlus"
  41.   else
  42.     set GraphSound to the number of cast "N_LimitSon"
  43.   end if
  44.   if the castNum of sprite SprFondBar = CastBarrette then
  45.     set the castNum of sprite SprBoutBar to GraphSound
  46.     updateStage()
  47.     RestoreBoutBar()
  48.   end if
  49. end
  50.  
  51. on Fusee
  52.   global SprFondBar, DcQuit, MemoNavPuce, NameExt, CastBarrette
  53.   if (MakeNomPropre(the movie) = "NAVIG") or (DcQuit = 1) or (word 1 of MemoNavPuce = "DEPART") then
  54.     exit
  55.   end if
  56.   PlaySound(1, "Puppet", "Fusee")
  57.   updateStage()
  58.   if the castNum of sprite SprFondBar = CastBarrette then
  59.     set t to " N_Fusee"
  60.     set C to t & t & "2" & t & "3" & t & "4" & t & "5" & t & "6" & t & "7" & t & "8" & " N_Vide"
  61.     AnimBouton(C)
  62.     RemetAnimBouton("N_Vide")
  63.   end if
  64.   GoMovie(":NAVIG")
  65. end
  66.  
  67. on RetourNavig
  68.   global MemoNavPuce
  69.   PlayClick()
  70.   set AccuA to ":" & word 2 of MemoNavPuce
  71.   set AccuB to word 3 of MemoNavPuce
  72.   GoMovieRepere(AccuA, AccuB)
  73. end
  74.  
  75. on Retour
  76.   global TypeBarrette, DcQuit, SprBoutBar, ColCastBar, CastEfface
  77.   if (char 14 of TypeBarrette <> "1") or (DcQuit = 1) then
  78.     exit
  79.   end if
  80.   PlayClick()
  81.   set the ink of sprite SprBoutBar to 0
  82.   set the locH of sprite SprBoutBar to ColCastBar * 40
  83.   set the castNum of sprite SprBoutBar to the number of cast "N_Retour"
  84.   updateStage()
  85.   RestoreBoutBar()
  86.   do(GestAvantRetour("Arriere", 1))
  87. end
  88.  
  89. on Suite
  90.   global TypeBarrette, DcQuit, SprBoutBar, ColCastBar, CastEfface
  91.   if (char 16 of TypeBarrette <> "1") or (DcQuit = 1) then
  92.     exit
  93.   end if
  94.   PlayClick()
  95.   set the ink of sprite SprBoutBar to 0
  96.   set the locH of sprite SprBoutBar to ColCastBar * 40
  97.   set the castNum of sprite SprBoutBar to the number of cast "N_Suite"
  98.   updateStage()
  99.   RestoreBoutBar()
  100.   do(GestAvantRetour("Avant", 2))
  101. end
  102.  
  103. on SautDePuce
  104.   global SprFondBar, DcQuit, MemoNavPuce, NameExt, CastBarrette, SprBoutBar, ColCastBar, CastEfface
  105.   if (the movieName = "NAVIG") or (DcQuit = 1) or (word 1 of MemoNavPuce = "DEPART") then
  106.     exit
  107.   end if
  108.   PlaySoundVide(1, "PUPPET", "Wizzz")
  109.   updateStage()
  110.   FalseReste()
  111.   if the castNum of sprite SprFondBar = CastBarrette then
  112.     set the ink of sprite SprBoutBar to 0
  113.     set the locH of sprite SprBoutBar to ColCastBar * 40
  114.     set the castNum of sprite SprBoutBar to the number of cast "N_SautDePuce"
  115.     updateStage()
  116.     RestoreBoutBar()
  117.   end if
  118.   set AccuA to word 6 of MemoNavPuce
  119.   if AccuA <> EMPTY then
  120.     do(AccuA)
  121.   end if
  122.   set AccuA to ":" & word 4 of MemoNavPuce
  123.   set AccuB to word 5 of MemoNavPuce
  124.   GoMovieRepere(AccuA, AccuB)
  125. end
  126.  
  127. on AnimBouton Champs
  128.   global glQTmemo, SprBoutBar, SprFondBar
  129.   TestPresenceQT()
  130.   if getAt(glQTmemo, 1) <> 0 then
  131.     if the movieRate of sprite getAt(glQTmemo, 1) <> 0 then
  132.       exit
  133.     end if
  134.   end if
  135.   set the ink of sprite SprBoutBar to 0
  136.   set the locV of sprite SprBoutBar to the top of sprite SprFondBar - 5
  137.   set the locH of sprite SprBoutBar to the left of sprite SprFondBar + 111
  138.   AnimSpriteCast(SprBoutBar, 6, Champs)
  139.   RestoreBoutBar()
  140. end
  141.  
  142. on RemetAnimBouton NomCastFin
  143.   global glQTmemo, SprBoutBar, SprFondBar
  144.   TestPresenceQT()
  145.   if getAt(glQTmemo, 1) <> 0 then
  146.     if the movieRate of sprite getAt(glQTmemo, 1) <> 0 then
  147.       exit
  148.     end if
  149.   end if
  150.   set the locV of sprite SprBoutBar to the top of sprite SprFondBar - 5
  151.   set the locH of sprite SprBoutBar to the left of sprite SprFondBar + 111
  152.   SetCastSprite(SprBoutBar, the number of cast NomCastFin)
  153.   updateStage()
  154. end
  155.  
  156. on AnnuleAvantRetour
  157.   global listAvanrRetour
  158.   set listAvanrRetour to list()
  159. end
  160.  
  161. on SetAvantRetour listPara
  162.   global listAvanrRetour
  163.   set listAvanrRetour to listPara
  164.   set listPara to list()
  165.   set Nbretest to count(listAvanrRetour) / 4
  166.   set Pz to 1
  167.   repeat with compt = 1 to Nbretest
  168.     set Far to getAt(listAvanrRetour, Pz)
  169.     if stringp(Far) then
  170.       setAt(listAvanrRetour, Pz, label(Far))
  171.     end if
  172.     set Fav to getAt(listAvanrRetour, Pz + 1)
  173.     if stringp(Fav) then
  174.       setAt(listAvanrRetour, Pz + 1, label(Fav))
  175.     end if
  176.     set Pz to Pz + 4
  177.   end repeat
  178.   addAt(listAvanrRetour, 1, Nbretest)
  179. end
  180.  
  181. on GestAvantRetour NomMacro, operande
  182.   global listAvanrRetour
  183.   if (listAvanrRetour = list()) or voidp(listAvanrRetour) then
  184.     return NomMacro
  185.   end if
  186.   set NumFrame to the frame
  187.   set Pz to 2
  188.   repeat with compt = 1 to getAt(listAvanrRetour, 1)
  189.     if getAt(listAvanrRetour, Pz) < NumFrame then
  190.       if getAt(listAvanrRetour, Pz + 1) > NumFrame then
  191.         set NomMacro to getAt(listAvanrRetour, Pz + 1 + operande)
  192.         return NomMacro
  193.       end if
  194.     end if
  195.     set Pz to Pz + 4
  196.   end repeat
  197.   return NomMacro
  198. end
  199.